package org.seamon.management.util.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.seamon.management.util.enums.ErrorCodeEnum;

@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {
    private final int errorCodeEnum;
    private final String message;

    public BusinessException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getMessage());
        this.errorCodeEnum = errorCodeEnum.getCode();
        this.message = errorCodeEnum.getMessage();
    }
}
